<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.sfilyh.util.DBUtil" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>sfilyh的博客</title>
    <!-- Bootstrap -->
     <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
 	    padding-bottom: 40px;
      }
     </style>
    <link href="<%=request.getContextPath()%>/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>
  
   <jsp:include page="/WEB-INF/views/top.jsp" />
   
    <div class="container">
      <div class="row">
	      <div class="span9">
	      	<blockquote>
			  <p>标签:${navTitle}<c:if test="${empty navTitle}">首页</c:if></p>
			</blockquote>
			<c:forEach var="item" items="${pb.pageData}">	      
          	<div class="articleList">
            	<h2><a href="<%=request.getContextPath()%>/view?id=${item.id}">${item.title}</a></h2>
                <span>sfilyh / <a href="<%=request.getContextPath()%>/article?cid=${item.category}">${item.cname}</a> / ${item.ftime}</span>                
            	<div style="margin-top:10px;">
                	<c:choose>
                	<c:when test="${item.ispass == 0 || empty item.ispass || artilce_pwd.get(item.id.toString())}">
                		${item.content}
                	</c:when>
                	<c:otherwise>
                	<form action="<%=request.getContextPath()%>/password" method="post">
                		<input type="hidden" name="id" value="${item.id}" />
						<jsp:include page="/WEB-INF/views/airticle_password.jsp" />
					</form>                		
                	</c:otherwise>
                </c:choose>       
                </div>
                
                <div style="margin-top: 10px;">
                <button class="ds-thread-count btn btn-mini" type="button" data-thread-key="${item.id}">暂无评论</button>
                <a class="btn btn-mini" href="<%=request.getContextPath()%>/view?id=${item.id}#comments">去说两句</a>
                </div>
                
                <hr />
            </div>
            </c:forEach>            
            
            
           <ul class="pager">     
              <c:choose>
              	<c:when test="${pb.hasPrePage}">
              		<li class="previous" ><a href="<%=request.getContextPath()%>/article?cid=${cid}&page=${pb.prePage}">← 上一页</a></li>
              	</c:when>
              	<c:otherwise>
              		<li class="previous disabled"><a href="javascript:;">← 上一页</a></li>
              	</c:otherwise>
              </c:choose>
              
              <c:choose>
              	<c:when test="${pb.hasNextPage}">
              		<li class="next"><a href="<%=request.getContextPath()%>/article?cid=${cid}&page=${pb.nextPage}">下一页 →</a></li>
              	</c:when>
              	<c:otherwise>
              		<li class="next disabled"><a href="javascript:;">下一页 →</a></li>
              	</c:otherwise>
              </c:choose>
              
            </ul>            
          </div> 
          
          <jsp:include page="/WEB-INF/views/right.jsp" />   
      </div>
    </div> <!-- /container -->
   
    <jsp:include page="/WEB-INF/views/footer.jsp" />
    
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
  </body>
</html>